﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DC2010;

namespace DC2010_EditorInfo.Controls
{
    public partial class DungeonGfxUC : UserControl
    {
        public DungeonGfx GFX;

        public DungeonGfxUC()
        {
            InitializeComponent();
        }

        private void DungeonGfxUC_Load(object sender, EventArgs e)
        {
            GFX = new DungeonGfx();
        }

        public void AssignGFX(DungeonGfx gfx)
        {
            GFX = gfx;

            if (!DesignMode)
            {
                if (GFX != null)
                {
                    checkBox1.Checked = GFX.IsAnimated;
                    textBox1.Text = GFX.Texture;
                    textBox2.Text = GFX.TileWidth.ToString();
                    textBox3.Text = GFX.TileHeight.ToString();
                    textBox4.Text = GFX.Delay.ToString();
                }
            }
        }

        public void Collect()
        {
            GFX.IsAnimated = checkBox1.Checked;
            GFX.Texture = textBox1.Text;
            GFX.TileWidth = textBox2.Text.ToInt();
            GFX.TileHeight = textBox3.Text.ToInt();
            GFX.Delay = textBox4.Text.ToInt();
        }
    }
}
